package com.yj.timecapsule.common.enums;

import lombok.Getter;

@Getter
public enum ErrorCode {
    /**
     * 通用
     */
    SUCCESS(0, "成功"),
    FAIL(1, "失败"),

    /**
     * 短信模块以2xxx开头
     */
    SEND_MESSAGE_TOO_FREQUENT(20002, "短信发送过于频繁"),
    SMS_CODE_SEND_ERROR(20001, "短信验证码发送失败"),
    SMS_CODE_ERROR(20003, "验证码过期或无效,请重新发送"),

    /**
     * 文件模块错误以3xxx开头
     */
    FILE_UPLOAD_ERROR(30002, "文件上传失败"),

    /**
     * 通用服务器异常 code = 500
     */
    SERVER_ERROR(500, "服务器异常"),
    /**
     * 用户模块错误以1xxx开头
     */
    USER_NOT_LOGIN(401, "未登录"),
    PHONE_NUMBER_ERROR(10001, "手机号格式错误"),
    SELF_FRIEND_REQUEST(10002, "不能添加自己为好友"),
    USER_NOT_FOUND(10003, "用户未找到"),



    /**
     * 日记模块错误以4xxx开头
     */
    DIARIES_PUBLICATION_FAILURE(40001, "超过七天的日记不可修改"),


    DIARIES_NOT_FOUND(40002, "日记已被删除或不存在"),
    /**
     * 通讯模块以5xxx开头
     */
    CONNECTION_TO_MANY(50001, "当前访问人数过多，请稍后重试！"),
    NOT_CONNECTION(50002, "没有创建连接,请重试！"),



    ;



    private int code;
    private String msg;

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }



}
